package game;
import gameobjects.Kitty;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;

import com.golden.gamedev.Game;
import com.golden.gamedev.GameLoader;
import com.golden.gamedev.object.AnimatedSprite;
import com.golden.gamedev.object.Background;
import com.golden.gamedev.object.CollisionManager;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;
import com.golden.gamedev.object.background.ColorBackground;
import com.golden.gamedev.object.sprite.AdvanceSprite;


public class BadAssKitteh extends Game {

    private Background myBackground;
    private Kitty myKitty;
    private CollisionManager myCollisionManager;
    private Sprite test;
    private SpriteGroup one;
    private SpriteGroup two;
    
    
    @Override
    public void initResources() {
        
        
        myBackground = new ColorBackground(Color.WHITE, 1024, 640);
        
        myKitty = new Kitty(this);
        myKitty.setBackground(myBackground);
        
        test = new Sprite(this.getImage("Resources/purpleblock.jpg"));
        test.setLocation(500, 500);
        test.setBackground(myBackground);
        myCollisionManager = new Collision();
        one = new SpriteGroup("one");
        one.add(myKitty);
        two = new SpriteGroup("two");
        two.add(test);
        myCollisionManager.setCollisionGroup(two, one);
    }

    @Override
    public void render(Graphics2D g) {
       myBackground.render(g);
       myKitty.render(g); 
       test.render(g); 
    }

    @Override
    public void update(long elapsedTime) {
        myBackground.update(elapsedTime);
        myCollisionManager.checkCollision();
        myKitty.checkKeyboardInputandUpdate(elapsedTime);
    }
}
